﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Runtime.InteropServices;

namespace MongoDb.EntityFramework
{
    [ComVisible(true)]
    public interface IRepository : IDisposable
    {
        void Delete<T>(Expression<Func<T, bool>> expression) where T : class, new();

        void Delete<T>(T item) where T : class, new();

        void DeleteAll<T>() where T : class, new();

        T Single<T>(Expression<Func<T, bool>> expression) where T : class, new();

        IEnumerable<T> Where<T>(Expression<Func<T, bool>> expression) where T : class, new();

        IQueryable<T> All<T>() where T : class, new();

        IQueryable<T> All<T>(int page, int pageSize) where T : class, new();

        void Add<T>(T item) where T : class, new();

        void Add<T>(IEnumerable<T> items) where T : class, new();

        void Update<T>(T item, Expression<Func<T, bool>> expression) where T : class, new();

        void Update<T>(IEnumerable<T> items, Expression<Func<T, bool>> expression) where T : class, new();
    }
}